package org.garbagecan.xstreamstudy.alias;

import com.thoughtworks.xstream.converters.SingleValueConverter;

public class AuthorConverter implements SingleValueConverter {
	public Object fromString(String name) {
		return new Author(name);
	}

	public String toString(Object obj) {
		return ((Author) obj).getName();
	}

	public boolean canConvert(Class clazz) {
		return clazz.equals(Author.class);
	}
}